package com.sniff.atp.enums.status;

import lombok.Getter;

import java.math.BigDecimal;

/**
 * 配用配置
 */
@Getter
public enum AdditionConfig {

    CLEAR_D2C("2C", "既成品采购", "6", "1", "商品数量*定价（元）"),
    MARKET_D2C("2C", "市场商品采购", "1", "1", "商品数量*定价（元）"),
    CLEAR_B2B("2B", "既成品采购", "5", "0.01", "查看配置项：销售价*定价（%）"),
    MARKET_B2B("2B", "市场商品采购", "5", "1", "查看配置项：商品数量*定价（元）"),
    OEM_B2B("B2B", "OEM商品采购", "5", "0.01", "查看配置项：销售价*定价（%）"),
    OEM_D2C("D2B", "OEM商品采购", "20", "0.01", "查看配置项：销售价*定价（%）"),
    EXPRESS_CLEAR("2B&2C透明购", "国内运费", "10", "1.2", "查看配置项：固定10块 * 120%"),
    EXPRESS_OEM("2B&2C-OEM", "国内运费", "20", "1", "查看配置项：固定20块"),
    ;

    private String platform;
    private String additionName;
    private String cost;
    private String coefficient;
    private String calculateConfigFormula;

    AdditionConfig(String platform, String additionName, String cost, String coefficient, String calculateConfigFormula) {
        this.additionName = additionName;
        this.calculateConfigFormula = calculateConfigFormula;
        this.cost = cost;
        this.platform = platform;
        this.coefficient = coefficient;
    }

    public static BigDecimal getCost(AdditionConfig config) {
        return new BigDecimal(config.getCost()).multiply(new BigDecimal(config.getCoefficient()));
    }
}
